package cn.wolfcode.luowowo.website.controller;

import cn.wolfcode.luowowo.article.domain.Flight;
import cn.wolfcode.luowowo.common.util.AjaxResult;
import cn.wolfcode.luowowo.website.util.FlightResult;
import cn.wolfcode.luowowo.website.util.HttpUtils;
import com.alibaba.fastjson.JSON;
import org.apache.http.HttpResponse;
import org.apache.http.util.EntityUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("flight")
public class FlightController {

    @RequestMapping("")
    public Object index(Model model) {
        /*String host = "https://flight.market.alicloudapi.com";
        String path = "/flight/city";
        String method = "GET";
        String appcode = "6c509d55e19e4b0b84cea685182cf6f5";
        Map<String, String> headers = new HashMap<String, String>();*/
        //最后在header中的格式(中间是英文空格)为Authorization:APPCODE 83359fd73fe94948385f570e3c139105
        /*headers.put("Authorization", "APPCODE " + appcode);
        Map<String, String> querys = new HashMap<String, String>();*/
        try {
           /* HttpResponse response = HttpUtils.doGet(host, path, method, headers, querys);
            //获取response的body
            String json = EntityUtils.toString(response.getEntity());*/
            String json ="{\n" +
                    "  \"status\": \"0\",\n" +
                    "  \"msg\": \"ok\",\n" +
                    "  \"result\": [\n" +
                    "    {\n" +
                    "      \"cityname\": \"阿勒泰\",\n" +
                    "      \"citycode\": \"AAT\",\n" +
                    "      \"encityname\": \"Aletai\",\n" +
                    "      \"letter\": \"A\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"阿克苏\",\n" +
                    "      \"citycode\": \"AKU\",\n" +
                    "      \"encityname\": \"Aksu\",\n" +
                    "      \"letter\": \"A\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"鞍山\",\n" +
                    "      \"citycode\": \"AOG\",\n" +
                    "      \"encityname\": \"Anshan\",\n" +
                    "      \"letter\": \"A\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"安庆\",\n" +
                    "      \"citycode\": \"AQG\",\n" +
                    "      \"encityname\": \"Anqing\",\n" +
                    "      \"letter\": \"A\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"安顺\",\n" +
                    "      \"citycode\": \"AVA\",\n" +
                    "      \"encityname\": \"Anshun\",\n" +
                    "      \"letter\": \"A\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"阿拉善左旗\",\n" +
                    "      \"citycode\": \"AXF\",\n" +
                    "      \"encityname\": \"Alashanzuoqi\",\n" +
                    "      \"letter\": \"A\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"阿里\",\n" +
                    "      \"citycode\": \"NGQ\",\n" +
                    "      \"encityname\": \"Ali\",\n" +
                    "      \"letter\": \"A\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"阿拉善右旗\",\n" +
                    "      \"citycode\": \"RHT\",\n" +
                    "      \"encityname\": \"Alashanyouqi\",\n" +
                    "      \"letter\": \"A\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"阿尔山\",\n" +
                    "      \"citycode\": \"YIE\",\n" +
                    "      \"encityname\": \"Aershan\",\n" +
                    "      \"letter\": \"A\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"北京\",\n" +
                    "      \"citycode\": \"BJS\",\n" +
                    "      \"encityname\": \"Beijing\",\n" +
                    "      \"letter\": \"B\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"百色\",\n" +
                    "      \"citycode\": \"AEB\",\n" +
                    "      \"encityname\": \"Baise\",\n" +
                    "      \"letter\": \"B\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"包头\",\n" +
                    "      \"citycode\": \"BAV\",\n" +
                    "      \"encityname\": \"Baotou\",\n" +
                    "      \"letter\": \"B\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"毕节\",\n" +
                    "      \"citycode\": \"BFJ\",\n" +
                    "      \"encityname\": \"Bijie\",\n" +
                    "      \"letter\": \"B\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"北海\",\n" +
                    "      \"citycode\": \"BHY\",\n" +
                    "      \"encityname\": \"Beihai\",\n" +
                    "      \"letter\": \"B\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"北京(南苑机场)\",\n" +
                    "      \"citycode\": \"BJS,NAY\",\n" +
                    "      \"encityname\": \"Beijing(NANYUAN)\",\n" +
                    "      \"letter\": \"B\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"北京(首都国际机场)\",\n" +
                    "      \"citycode\": \"BJS,PEK\",\n" +
                    "      \"encityname\": \"Beijing(CAPITAL)\",\n" +
                    "      \"letter\": \"B\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"博乐\",\n" +
                    "      \"citycode\": \"BPL\",\n" +
                    "      \"encityname\": \"Bole\",\n" +
                    "      \"letter\": \"B\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"保山\",\n" +
                    "      \"citycode\": \"BSD\",\n" +
                    "      \"encityname\": \"Baoshan\",\n" +
                    "      \"letter\": \"B\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"白城\",\n" +
                    "      \"citycode\": \"DBC\",\n" +
                    "      \"encityname\": \"Baicheng\",\n" +
                    "      \"letter\": \"B\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"布尔津\",\n" +
                    "      \"citycode\": \"KJI\",\n" +
                    "      \"encityname\": \"Burqin\",\n" +
                    "      \"letter\": \"B\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"白山\",\n" +
                    "      \"citycode\": \"NBS\",\n" +
                    "      \"encityname\": \"Baishan\",\n" +
                    "      \"letter\": \"B\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"巴彦淖尔\",\n" +
                    "      \"citycode\": \"RLK\",\n" +
                    "      \"encityname\": \"Bayan Nur\",\n" +
                    "      \"letter\": \"B\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"成都\",\n" +
                    "      \"citycode\": \"CTU\",\n" +
                    "      \"encityname\": \"Chengdu\",\n" +
                    "      \"letter\": \"C\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"重庆\",\n" +
                    "      \"citycode\": \"CKG\",\n" +
                    "      \"encityname\": \"Chongqing\",\n" +
                    "      \"letter\": \"C\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"长沙\",\n" +
                    "      \"citycode\": \"CSX\",\n" +
                    "      \"encityname\": \"Changsha\",\n" +
                    "      \"letter\": \"C\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"承德\",\n" +
                    "      \"citycode\": \"CDE\",\n" +
                    "      \"encityname\": \"Chengde\",\n" +
                    "      \"letter\": \"C\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"常德\",\n" +
                    "      \"citycode\": \"CGD\",\n" +
                    "      \"encityname\": \"Changde\",\n" +
                    "      \"letter\": \"C\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"长春\",\n" +
                    "      \"citycode\": \"CGQ\",\n" +
                    "      \"encityname\": \"Changchun\",\n" +
                    "      \"letter\": \"C\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"朝阳\",\n" +
                    "      \"citycode\": \"CHG\",\n" +
                    "      \"encityname\": \"Chaoyang\",\n" +
                    "      \"letter\": \"C\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"赤峰\",\n" +
                    "      \"citycode\": \"CIF\",\n" +
                    "      \"encityname\": \"Chifeng\",\n" +
                    "      \"letter\": \"C\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"长治\",\n" +
                    "      \"citycode\": \"CIH\",\n" +
                    "      \"encityname\": \"Changzhi\",\n" +
                    "      \"letter\": \"C\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"沧源\",\n" +
                    "      \"citycode\": \"CWJ\",\n" +
                    "      \"encityname\": \"Cangyuan\",\n" +
                    "      \"letter\": \"C\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"常州\",\n" +
                    "      \"citycode\": \"CZX\",\n" +
                    "      \"encityname\": \"Changzhou\",\n" +
                    "      \"letter\": \"C\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"池州\",\n" +
                    "      \"citycode\": \"JUH\",\n" +
                    "      \"encityname\": \"Chizhou\",\n" +
                    "      \"letter\": \"C\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"潮州\",\n" +
                    "      \"citycode\": \"SWA\",\n" +
                    "      \"encityname\": \"Chaozhou\",\n" +
                    "      \"letter\": \"C\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"潮汕\",\n" +
                    "      \"citycode\": \"SWA\",\n" +
                    "      \"encityname\": \"Chaoshan\",\n" +
                    "      \"letter\": \"C\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"嘉义\",\n" +
                    "      \"citycode\": \"CYI\",\n" +
                    "      \"encityname\": \"Chiayi\",\n" +
                    "      \"letter\": \"C\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"大连\",\n" +
                    "      \"citycode\": \"DLC\",\n" +
                    "      \"encityname\": \"Dalian\",\n" +
                    "      \"letter\": \"D\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"大同\",\n" +
                    "      \"citycode\": \"DAT\",\n" +
                    "      \"encityname\": \"Datong\",\n" +
                    "      \"letter\": \"D\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"达县\",\n" +
                    "      \"citycode\": \"DAX\",\n" +
                    "      \"encityname\": \"Daxian\",\n" +
                    "      \"letter\": \"D\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"达州\",\n" +
                    "      \"citycode\": \"DAX\",\n" +
                    "      \"encityname\": \"Dazhou\",\n" +
                    "      \"letter\": \"D\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"稻城\",\n" +
                    "      \"citycode\": \"DCY\",\n" +
                    "      \"encityname\": \"Daocheng\",\n" +
                    "      \"letter\": \"D\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"丹东\",\n" +
                    "      \"citycode\": \"DDG\",\n" +
                    "      \"encityname\": \"Dandong\",\n" +
                    "      \"letter\": \"D\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"迪庆\",\n" +
                    "      \"citycode\": \"DIG\",\n" +
                    "      \"encityname\": \"Diqing\",\n" +
                    "      \"letter\": \"D\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"大理\",\n" +
                    "      \"citycode\": \"DLU\",\n" +
                    "      \"encityname\": \"Dali\",\n" +
                    "      \"letter\": \"D\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"敦煌\",\n" +
                    "      \"citycode\": \"DNH\",\n" +
                    "      \"encityname\": \"Dunhuang\",\n" +
                    "      \"letter\": \"D\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"东营\",\n" +
                    "      \"citycode\": \"DOY\",\n" +
                    "      \"encityname\": \"Dongying\",\n" +
                    "      \"letter\": \"D\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"大庆\",\n" +
                    "      \"citycode\": \"DQA\",\n" +
                    "      \"encityname\": \"Daqing\",\n" +
                    "      \"letter\": \"D\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"德令哈\",\n" +
                    "      \"citycode\": \"HXD\",\n" +
                    "      \"encityname\": \"Delingha\",\n" +
                    "      \"letter\": \"D\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"德宏\",\n" +
                    "      \"citycode\": \"LUM\",\n" +
                    "      \"encityname\": \"Dehong\",\n" +
                    "      \"letter\": \"D\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"额济纳旗\",\n" +
                    "      \"citycode\": \"EJN\",\n" +
                    "      \"encityname\": \"Ejinaqi\",\n" +
                    "      \"letter\": \"E\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"恩施\",\n" +
                    "      \"citycode\": \"ENH\",\n" +
                    "      \"encityname\": \"Enshi\",\n" +
                    "      \"letter\": \"E\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"二连浩特\",\n" +
                    "      \"citycode\": \"ERL\",\n" +
                    "      \"encityname\": \"Erenhot\",\n" +
                    "      \"letter\": \"E\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"福州\",\n" +
                    "      \"citycode\": \"FOC\",\n" +
                    "      \"encityname\": \"Fuzhou\",\n" +
                    "      \"letter\": \"F\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"阜阳\",\n" +
                    "      \"citycode\": \"FUG\",\n" +
                    "      \"encityname\": \"Fuyang\",\n" +
                    "      \"letter\": \"F\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"佛山\",\n" +
                    "      \"citycode\": \"FUO\",\n" +
                    "      \"encityname\": \"Foshan\",\n" +
                    "      \"letter\": \"F\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"抚远\",\n" +
                    "      \"citycode\": \"FYJ\",\n" +
                    "      \"encityname\": \"Fuyuan\",\n" +
                    "      \"letter\": \"F\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"富蕴\",\n" +
                    "      \"citycode\": \"FYN\",\n" +
                    "      \"encityname\": \"Fuyun\",\n" +
                    "      \"letter\": \"F\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"广州\",\n" +
                    "      \"citycode\": \"CAN\",\n" +
                    "      \"encityname\": \"Guangzhou\",\n" +
                    "      \"letter\": \"G\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"果洛\",\n" +
                    "      \"citycode\": \"GMQ\",\n" +
                    "      \"encityname\": \"Golog\",\n" +
                    "      \"letter\": \"G\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    },\n" +
                    "    {\n" +
                    "      \"cityname\": \"格尔木\",\n" +
                    "      \"citycode\": \"GOQ\",\n" +
                    "      \"encityname\": \"Golmud\",\n" +
                    "      \"letter\": \"G\",\n" +
                    "      \"country\": \"中国\"\n" +
                    "    }\n" +
                    "  ]\n" +
                    "}";
            FlightResult flightResult = JSON.parseObject(json, FlightResult.class);
            List<Flight> flights = flightResult.getResult();

            //hotFlights initialA initialF  initialK  initialQ  initialX
            List<Flight> hotFlights = new ArrayList<>();
            List<Flight> initialA = new ArrayList<>();
            List<Flight> initialF = new ArrayList<>();
            List<Flight> initialK = new ArrayList<>();
            List<Flight> initialQ = new ArrayList<>();
            List<Flight> initialX = new ArrayList<>();

            for (Flight flight : flights) {
                if (flight.getCountry().equals("国际")) {
                    hotFlights.add(flight);
                }
                if (flight.getLetter().equals("A") || flight.getLetter().equals("B") || flight.getLetter().equals("C") || flight.getLetter().equals("D") || flight.getLetter().equals("E")) {
                    initialA.add(flight);
                }
                if (flight.getLetter().equals("F") || flight.getLetter().equals("G") || flight.getLetter().equals("H") || flight.getLetter().equals("J")) {
                    initialF.add(flight);
                }
                if (flight.getLetter().equals("K") || flight.getLetter().equals("L") || flight.getLetter().equals("M") || flight.getLetter().equals("N") || flight.getLetter().equals("P")) {
                    initialK.add(flight);
                }
                if (flight.getLetter().equals("Q") || flight.getLetter().equals("R") || flight.getLetter().equals("S") || flight.getLetter().equals("T") || flight.getLetter().equals("W")) {
                    initialQ.add(flight);
                }
                if (flight.getLetter().equals("X") || flight.getLetter().equals("Y") || flight.getLetter().equals("Z")) {
                    initialX.add(flight);
                }
            }
            model.addAttribute("hotFlights", hotFlights);
            model.addAttribute("initialA", initialA);
            model.addAttribute("initialF", initialF);
            model.addAttribute("initialK", initialK);
            model.addAttribute("initialQ", initialQ);
            model.addAttribute("initialX", initialX);

        } catch (Exception e) {
            e.printStackTrace();
        }
        return "flight/index";
    }

    @RequestMapping("search")
    @ResponseBody
    public Object search(Model model,String orgCity,String dstCity,String deptTime) {
//        String host = "https://flight.market.alicloudapi.com";
//        String path = "/flight/query";
//        String method = "GET";
//        String appcode = "6c509d55e19e4b0b84cea685182cf6f5";
//        Map<String, String> headers = new HashMap<String, String>();
//        //最后在header中的格式(中间是英文空格)为Authorization:APPCODE 83359fd73fe94948385f570e3c139105
//        headers.put("Authorization", "APPCODE " + appcode);
//        Map<String, String> querys = new HashMap<String, String>();
//        querys.put("city", orgCity);
//        querys.put("date", deptTime);
//        querys.put("endcity", dstCity);
        AjaxResult result = new AjaxResult();
        try {
//            HttpResponse response = HttpUtils.doGet(host, path, method, headers, querys);
//            //获取response的body
//            String json = EntityUtils.toString(response.getEntity());
            String json = "{\n" +
                    "  \"status\": \"0\",\n" +
                    "  \"msg\": \"ok\",\n" +
                    "  \"result\": {\n" +
                    "    \"flightno\": \"BA2310\",\n" +
                    "    \"date\": \"2018-06-05\",\n" +
                    "    \"punctualrate\": \"95\",\n" +
                    "    \"departport\": \"上海\",\n" +
                    "    \"departportcode\": \"PVG\",\n" +
                    "    \"arrivalport\": \"南京\",\n" +
                    "    \"arrivalportcode\": \"NKG\",\n" +
                    "    \"departterminal\": \"T2\",\n" +
                    "    \"arrivalterminal\": \"\",\n" +
                    "    \"depart\": \"2015-04-25 19:50:00\",\n" +
                    "    \"arrival\": \"2015-04-25 21:15:00\",\n" +
                    "    \"expecteddepart\": \"2015-06-05 22:50:00\",\n" +
                    "    \"expectedarrival\": \"2015-06-05 23:55:00\",\n" +
                    "    \"actualdepart\": \"2015-06-05 22:50:00\",\n" +
                    "    \"actualarrival\": \"2015-06-05 23:55:00\",\n" +
                    "    \"status\": \"到达\",\n" +
                    "    \"gate\": \"\",\n" +
                    "    \"luggagetray\": \"\",\n" +
                    "    \"counter\": \"\",\n" +
                    "    \"arrpunctualrate\": \"32\"\n" +
                    "  }\n" +
                    "}";
            result.setData(json);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return result;
    }

}

